package com.hzncc.flowable_diboot.custom_field.excel.model;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.lang.Double;
import java.math.BigDecimal;

import com.alibaba.excel.enums.BooleanEnum;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.diboot.core.util.D;
import com.diboot.core.util.V;
import com.diboot.core.data.copy.Accept;
import com.diboot.file.excel.BaseExcelModel;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.NotNull;

/**
* 销售合同 导出model定义
*
* @author MyName
* @version 1.0
* @date 2024-11-22
 * Copyright © MyCorp
*/
@Getter
@Setter
@ExcelIgnoreUnannotated
public class SalesContractExportModel extends BaseExcelModel {

    /**
    * 租户
    */
    @ExcelProperty(value = "租户")
    private String tenantIdLabel;
    /**
    * 采购订单编号
    */
    @ExcelProperty(value = "采购订单编号")
    private String orderCode;

    /**
    * 售达方
    */
    @ExcelProperty(value = "售达方")
    private String soldToParty;

    /**
    * 售达方SAP编号
    */
    @ExcelProperty(value = "售达方SAP编号")
    private String soldToPartySapCode;

    /**
    * 送达方
    */
    @ExcelProperty(value = "送达方")
    private String recipient;

    /**
    * 送达方SAP编号
    */
    @ExcelProperty(value = "送达方SAP编号")
    private String recipientSapCode;

    /**
    * 业务板块
    */
    @Accept(name = "businessModelLabel.label")
    @ExcelProperty(value = "业务板块")
    private String businessModelLabel;
    /**
    * 业务部门
    */
    @ExcelProperty(value = "业务部门")
    private String businessDept;

    /**
    * 凭证日期
    */
    @DateTimeFormat(D.FORMAT_DATE_Y4MD)
    @ExcelProperty(value = "凭证日期")
    private LocalDate documentDate;

    /**
    * 销售区域
    */
    @Accept(name = "salesTerritoryLabel.label")
    @ExcelProperty(value = "销售区域")
    private String salesTerritoryLabel;
    /**
    * 合同附件文本
    */
    @ExcelProperty(value = "合同附件文本")
    private String textOfAttachment;

    /**
    * 订购项目
    */
    @ExcelProperty(value = "订购项目")
    private String orderItem;

    /**
    * 订购型号
    */
    @ExcelProperty(value = "订购型号")
    private String orderModel;

    /**
    * 订购数量
    */
    @ExcelProperty(value = "订购数量")
    private String orderQuantity;

    /**
    * 系统通道
    */
    @Accept(name = "systemChannelLabel.label")
    @ExcelProperty(value = "系统通道")
    private String systemChannelLabel;
    /**
    * 交（提）货时间
    */
    @Accept(name = "deliveryTimeLabel.label")
    @ExcelProperty(value = "交（提）货时间")
    private String deliveryTimeLabel;
    /**
    * 质量条件
    */
    @Accept(name = "qualityConditionLabel.label")
    @ExcelProperty(value = "质量条件")
    private String qualityConditionLabel;
    /**
    * 产品性质
    */
    @Accept(name = "productNatureLabel.label")
    @ExcelProperty(value = "产品性质")
    private String productNatureLabel;
    /**
    * 付款方式
    */
    @Accept(name = "paymentMethodLabel.label")
    @ExcelProperty(value = "付款方式")
    private String paymentMethodLabel;
    /**
    * 销售雇员
    */
    @ExcelProperty(value = "销售雇员")
    private String salesEmployee;

    /**
    * 销售雇员工号
    */
    @ExcelProperty(value = "销售雇员工号")
    private String salesEmployeeNumber;

    /**
    * 销售组织
    */
    @ExcelProperty(value = "销售组织")
    private String salesOrganization;

    /**
    * 分销渠道
    */
    @Accept(name = "distributionChannelLabel.label")
    @ExcelProperty(value = "分销渠道")
    private String distributionChannelLabel;
    /**
    * 产品组
    */
    @Accept(name = "productGroupLabel.label")
    @ExcelProperty(value = "产品组")
    private String productGroupLabel;
    /**
    * 固定折扣价金额
    */
    @ExcelProperty(value = "固定折扣价金额")
    private String fixedDiscountAmount;

    /**
    * 已收款金额
    */
    @ExcelProperty(value = "已收款金额")
    private String amountReceived;

    /**
    * 未收款金额
    */
    @ExcelProperty(value = "未收款金额")
    private String amountNotReceived;

    /**
    * 发货情况
    */
    @Accept(name = "deliveryStatusLabel.label")
    @ExcelProperty(value = "发货情况")
    private String deliveryStatusLabel;
    /**
    * 开票情况
    */
    @Accept(name = "invoiceStatusLabel.label")
    @ExcelProperty(value = "开票情况")
    private String invoiceStatusLabel;
    /**
    * 收款情况
    */
    @Accept(name = "paymentStatusLabel.label")
    @ExcelProperty(value = "收款情况")
    private String paymentStatusLabel;    private Boolean isCancel;
    /**
    * 是否取消
    */
    @ExcelProperty(value = "是否取消")
    private String isCancelLabel;
    /**
    * 失败原因
    */
    @ExcelProperty(value = "失败原因")
    private String failureCause;

    /**
    * 推送状态
    */
    @ExcelProperty(value = "推送状态")
    private Integer pushStatus;

    /**
    * SAP编码
    */
    @ExcelProperty(value = "SAP编码")
    private String sapCode;

    /**
    * 合同类型
    */
    @ExcelProperty(value = "合同类型")
    private String contractType;

    /**
    * 合同项目
    */
    @ExcelProperty(value = "合同项目")
    private String contractProductId;

    /**
    * 项目合同id
    */
    @ExcelProperty(value = "项目合同id")
    private String projectContractId;

    public void setIsCancel(Boolean isCancel) {
        this.isCancel = isCancel;
        if (isCancel != null) {
            this.isCancelLabel = isCancel ? "是" : "否";
        }
    }
}